import http from '@/utils/http'
import { getList, addItem, deleteById, updateMsg } from "./common";

// #region 商品管理
// 获取商品列表
export const getItemList = getList('/foster/item/list')

// 添加商品信息
export const addItemMsg = addItem('/foster/item/addItem')

// 修改商品数据
export const updateItem = updateMsg('/foster/item/updateItem')

// 删除商品数据
export const deleteItem = deleteById('/foster/item/deleteItem')
// #endregion

// #region 用户管理
// 获取用户列表
export const getUserList = getList('/foster/user/list')

// 修改用户信息
export const updateUser = updateMsg('/foster/user/updateUser')

// 删除用户数据
export const deleteUser = deleteById('/foster/user/deleteUserById')
// #endregion

// #region 房间管理
// 获取房间列表
export const getRoomList = getList('/foster/room/listAllRooms')

// 添加房间信息
export const addRoomMsg = addItem('/foster/room/addRoom')

// 修改房间信息
export const updateRoom = updateMsg('/foster/room/updateRoom')

// 删除房间数据
export const deleteRoom = deleteById('/foster/room/deleteRoomById')
// #endregion

// #region 宠物管理
// 获取宠物列表
export const getPetList = getList('/foster/pet/list')

// 添加宠物信息
export const addPetMsg = addItem('/foster/pet/addPet')

// 修改宠物信息
export const updatePet = updateMsg('/foster/pet/updatePet')

// 删除宠物数据
export const deletePet = deleteById('/foster/pet/deletePetById')

// 获取单个宠物状态信息
export const getPetStatus = (id) => {
    return http.get(`/foster/petStatus/getPetStatusById/${id}`)
}

// 添加宠物状态
export const addPetStatus = (petStatusMsg) => {
    return http.post('/foster/petStatus/addPetStatus', {
        ...petStatusMsg
    })
}
// 删除宠物状态
export const deletePetStatus = deleteById('/foster/petStatus/detelePetStatusById')

// 修改宠物状态
export const upadtePetStatus = updateMsg('/foster/petStatus/updatePetStatus')
// #endregion